<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="js/jquery-3.3.0.js"></script>
</head>
<body>
	welcome!!!
	<form action="" enctype="multipart/form-data">
		<input type="file" id="img" value="选择图片"> <input type="button"
			value="测试发布约会" onclick="test()">
			<img src="imgs/appointment/20190412115056绘制模式.png">
	</form>
    
	<script type="text/javascript">
		function test() {
			alert('点击事件');
			var formdata = new FormData();
			var img = $("#img").get(0).files[0];
			formdata.append("ispingtai", true);
			formdata.append("jindu", 21);
			formdata.append("weidu", 23);
			formdata.append("context", "这是发布内容");
			formdata.append("date", "2017/03/02");
			formdata.append("starttime", "09:00");
			formdata.append("endtime", "10:30");
			formdata.append("num", 1);
			formdata.append("meijin", 300);
			formdata.append("ucount", "dengshilin");
			formdata.append("address", "网易咖啡馆");
			formdata.append("img", img);

			$.ajax({
				url : "addAppointment",
				type : "POST",
				data : formdata,
				processData : false,
				contentType : false,
				success : function(result) {
					alert(result.message);
				}
			})
		}
	</script>
</body>
</html>